﻿using System;
using System.Collections.Generic;
using System.ComponentModel.DataAnnotations.Schema;
using System.Linq;
using System.Web;

namespace NewRen.Models
{
    public class MoneyRecord
    {
        public int ID { get; set; }
        [ForeignKey("User")]
        public int UserID { get; set; }
        public virtual User User { get; set; }
        public double Money { get; set; }
        public DateTime Time { get; set; }
        /// <summary>
        /// 备注
        /// </summary>
        public string Hint { get; set; }

        /// <summary>
        /// 收支类型
        /// </summary>
        public int TransactionAsInt { set; get; }


        [NotMapped]
        public TransactionType Transaction
        {
            set { TransactionAsInt = (int)value; }
            get { return (TransactionType)TransactionAsInt; }
        }
    }
}